home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_oth / tm480 / tmexam.exe / TMDEV.TSK < prev    next >
Text File  |  1991-09-10  |  15KB  |  481 lines

  1. ; Title   : TMDEV.TSK                   Last Updated : August 21, 1991
  2. ; Author  : Steve Johnson - FmP.        Version      : 1.30
  3. ; Purpose : A Task development harness.
  4. ; Notes   : Uses SAVE and RESTORE to file called TMDEV.TM
  5. ;           The task will not allow users to select options requiring a
  6. ;           filename until they have confirmed the name found in the restore
  7. ;           operation, but it does remember which option they wanted to
  8. ;           perform and performs it after filename confirmation.
  9. ;           Quiet flag ignored by shareware version.
  10. ; Latest  : Use of new @BBHELP facility
  11. ;         : Use of FMPTM and FMPSCR for expert users
  12. ; Version 1.20:
  13. ;         : Addition of LIST for View option
  14. ;         : Keyvals added 
  15. ;         : Default is now reserved word changed to defcol
  16. ;         : Shellout option added 
  17.  
  18. var fmptm,20,$fmptm
  19. var fmpscr,20,$fmpscr
  20. var keyvals,8,'zDIESQVM'     ;z is impossible (not UPPER case)
  21. int i                ;saves choice 
  22. int count                       ;Loop counter
  23. int deferred_choice             ;Saves impossible choice numbers
  24. int fstat                       ;File verification status
  25. int main_choice                 ;Saves choice from outer menu
  26. int tskmac            ;Remembers MAC or TSK 
  27. var continue,12                 ;Holds return label
  28. logical selected                ;True is user specified a filename
  29.  
  30. var char,1
  31. var default_drive,1
  32. var drive,2                     ;Drive id followed by colon
  33. var editor,8,'LIST'             ;Name of editor
  34. var extension,3                 ;Last 3 characters of filename
  35. var file_bytes,1,occurs 14      ;Used to extract parts of SOURCE_FILE
  36. var filename,8,'   TMDEV'       ;1st 8 characters of filename
  37. var fullname,14                 ;This contains filename without spaces
  38. var macname,14                  ;The name of the MAC file
  39. var help_no,2
  40. var help_name,6
  41. var mac,1,"n"                   ;If Y: There is a MAC file for this TSK
  42. var mono,1,"y"                  ;If Y: Invoke Taskmaster with /M flag
  43. var names,1,"n"                 ;If Y: Invoke Taskmaster with /S flag
  44. var null,1                      ;Used to reset FILENAME and EXTENSION
  45. var postflags,8                 ;Editor flags after filename
  46. var preflags,8                  ;Editor flags preceding filename
  47. var quiet,1,"n"                 ;If Y: Invoke Taskmaster with /Q flag
  48. var source_file,14,'c:test.tsk' ;Dummy filename
  49. var tm_flags,6
  50. var one_space,1,' '
  51. var two_spaces,2,'  '
  52. var command_line,41
  53. var comspec,30,$comspec
  54.  
  55. vconst attention,79             ;Highlight colour combinationèvconst cel,55                   ;Clear to end of line
  56. vconst cep,56                   ;Clear to end of page (screen)
  57. vconst cls,11                   ;Clear screen
  58. vconst defcol,5                 ;Default colour combination
  59.  
  60. end
  61.  
  62. if comspec = null
  63.   move 'c:\command' to comspec
  64. fi
  65. if fmpscr = null
  66.   move 'SCR' to fmpscr
  67. fi
  68. if fmptm = null
  69.   move 'TM' to fmptm
  70. fi
  71. move ddrive to default_drive
  72. lookfor tmdev.ovr        ;Check forms available
  73. if not found
  74.   forms logon.ovr       ;in case /q and not registered
  75.   insert filename filename
  76.   put "NO_FORMS"
  77.   stop
  78. fi
  79. forms tmdev.ovr          ;open forms file for use
  80. display cls
  81. if colour
  82.   move "n" to mono
  83. fi
  84. lookfor tmdev.tm         ;if the task has been used previously
  85. if found
  86.   restore 'tmdev.tm' source_file editor mac mono names quiet preflags postflags
  87. ; use old filename editor name and flag settings
  88.   if resp ne 0
  89.     Displayln "TMDEV: Failure during restoration of data from TMDEV.TM"
  90.     wait "Please try deleting it - press any key to abort"
  91.     stop
  92.   fi
  93.   restore
  94.   put "HELP_GEN" wait 0 noclear
  95. else
  96.   move '1INIT' to continue
  97.   goto 1GETDEFAULTS
  98. 1INIT
  99.   if anyfk
  100.     stop
  101.   fi
  102.   put "HELP_GEN" wait 0 noclear
  103. fi
  104. move true to hide
  105. move 0c000h to bbmask ;<esc> and F1
  106. menu 1,'BBMENU'
  107. option 1,1
  108.   clear selected
  109.   until selected or funkey = 10è    move '1GOTDEFAULTS' to continue
  110.     goto 1GETDEFAULTS
  111. 1GOTDEFAULTS
  112.     if selected
  113.       if deferred_choice ne 0
  114.     move deferred_choice to choice
  115.     if not anyfk
  116.       clear deferred_choice
  117.       cursor 2 0 defcol cel "Now I can action your selection..."
  118.       return 100
  119.     fi
  120.       else
  121.     cursor 2 0 defcol cel "Filename confirmed..."
  122.       fi
  123.     else
  124.       cursor 2 0 defcol cel "You must confirm a filename before "
  125.       display "I can action your selection"
  126.       put "HELP_GEN" wait 0 noclear
  127.       move 10 to funkey
  128.     fi
  129.   fi
  130.   return
  131. option 1,2
  132. option 1,3
  133. option 1,4
  134. option 1,6
  135.   if not selected
  136.     move hilite to deferred_choice
  137.     move 1 to choice
  138.     return 100
  139.   fi
  140.   cursor 2 0 defcol cep
  141.   userline          ;Prevents video mode change
  142.   if choice = 2
  143.     select drive
  144.     run default_drive ':' fmptm 1 tm_flags 1 drive filename
  145.     select default_drive
  146.     cursor 21 50 attention " TMDEV: Press any key " defcol
  147.     inkey char
  148.     cursor 2 0 defcol cep
  149.     upper char
  150.     if keyvals ct char
  151.       move fcol to choice 
  152.       return 100
  153.     fi
  154.   fi
  155.   if choice = 3 or choice = 6 and mac = 'y' or mac = 'Y'  
  156.     move choice to i
  157.     move tskmac to choice
  158.     put 'TSKMAC'
  159.     move hilite to tskmac 
  160.     move i to choice
  161.     if choice = 6
  162.       run 'list ' drive filename '.' display
  163.       returnè    fi
  164.   fi
  165.   if choice = 6
  166.     run 'list ' fullname
  167.     return
  168.   fi
  169.   if choice = 3
  170.     combine editor 1 preflags 1 into command_line
  171.     if mac = 'y' or mac = 'Y'  
  172.       append filename '.' display to command_line
  173.     else 
  174.       append fullname to command_line
  175.     fi
  176.     append 1 postflags to command_line
  177.     move 1 to resp
  178.     until resp = 0
  179.       replace all two_spaces of command_line with one_space
  180.     fi
  181.     trim command_line
  182.     move 0 to elevel
  183.     run command_line
  184.     if elevel ne 0 or resp ne 0
  185.       cursor 21 50 attention " TMDEV: Press any key "  defcol
  186.       inkey char
  187. ;     let user see the error message... (if there is one!)
  188.     fi
  189.     cursor 2 0 defcol cep
  190.   fi
  191.   if choice = 4
  192.     select drive
  193.     run default_drive ":" fmpscr 1 filename ' /p'
  194.     select default_drive
  195.     if resp ne 0
  196.       put "HELP04"
  197.     fi
  198.   fi
  199.   return
  200. option 1,7
  201.   display defcol cls 'Please type EXIT<return> to return to TMDEV'
  202.   run 'command'
  203.   return
  204. option 1,5
  205. option 1,30     ;<esc>
  206.   stop
  207. option 1,31
  208.   move hilite to help_no with lead_zeroes
  209.   combine "HELP" help_no into help_name
  210.   move hilite to main_choice
  211.   put help_name 
  212.   move main_choice to choice
  213.   return
  214. endm 1
  215.  
  216. 1GETDEFAULTS
  217. clear selectedèuntil selected or anyfk
  218.   append 8 to editor
  219.   fieldfill source_file mac mono names quiet editor preflags postflags
  220.   put 'NAME_EXT' 
  221.   if not anyfk
  222.     get source_file mac mono names quiet editor preflags postflags
  223.     upper mono quiet mac names
  224.     sizevar tm_flags 0
  225.     if mono = "Y"
  226.       append '/m' to tm_flags
  227.     fi
  228.     if quiet = "Y"
  229.       append '/q' to tm_flags
  230.     fi
  231.     if names = "Y"
  232.       append '/s' to tm_flags
  233.     fi
  234.     trim editor preflags postflags source_file
  235.     verify source_file using fstat source_file
  236. ;   fstat must be 0: using an @file field!
  237.     move source_file to file_bytes
  238.     CLEAR count DRIVE extension filename char
  239.     setscan source_file
  240.     move zero to delim
  241.     scan drive filename char extension
  242.     trim filename extension
  243.     combine drive filename '.' extension into fullname
  244.     combine drive filename '.MAC'  into macname
  245.     if extension = "TSK"
  246.       if filename = "TMDEV"
  247.     cursor 1 0 attention "TMDEV cannot be used to develop itself!" defcol cel
  248.       else
  249.     dir fullname
  250.     if found
  251.       move true to selected
  252.     else
  253.       cursor 1 0
  254.       ask selected cel 'Warning: No such file as ' source_file '. Proceed? '
  255.     fi
  256.         if mac = 'Y'
  257.           dir macname
  258.       if not found
  259.             cursor 1 0 cel 'Error: No such file as ' macname ' Press a key'
  260.             inkey char
  261.             move 'N' to mac
  262.             clear selected
  263.           fi
  264.     fi
  265.       fi
  266.     else
  267.       cursor 1 0 attention "Tasks must have a filetype of TSK !" defcol cel
  268.       inkey char
  269.       move "TSK" to extension
  270.       combine drive filename '.' extension into fullname
  271.       verify fullname using fstat source_fileè    fi
  272.   fi
  273. fi
  274. if not anyfk
  275.   save 'tmdev.tm' source_file editor mac mono names quiet preflags postflags
  276.   save
  277. fi
  278. ;saves data for next run.
  279. ;cursor 2 0 defcol cep
  280. GOBACK continue
  281. @VID
  282. @defaults bright,cyan,blue
  283. @nf NAME_EXT
  284. @FILE
  285. @acceptfk f10
  286. @logical
  287. @logical
  288. @logical
  289. @logical
  290. @string min1
  291. @string
  292. @string
  293. @col char,white,blue
  294. @window line0,column70,depth1,width8
  295. F10=Quit
  296. @col char,white,blue
  297. @window line 2,column5,depth 15,width70
  298. @drop under,offset 2
  299. @double_line
  300. @dim
  301. @gon
  302. 7-------------------------------------------------------------------9 
  303. 0 Please confirm or edit details:                                   0
  304. 4----------------------------------------8--------------------------6
  305. 0 The name of the task being developed:  0 Use TAB,  or  to  move 0
  306. 0 Filename [              ]              0 between fields.   to 0
  307. 0 Separate MAC file [ ] Y or N           0 save any changes  or F10 0
  308. 4----------------------------------------2----------------9 to quit 0
  309. 0 When invoking Taskmaster:                               4---------6
  310. 0 Use Mono mode [ ] Show Formnames [ ] Use Quiet mode [ ] 0         0
  311. 4---------------------------------------------------------3         0
  312. 0 The Editor will be invoked as:                                    0
  313. 0 Editor_name {{pre_flags}} filename {{post_flags}}                     0
  314. 0 Please specify:                                                   0
  315. 0 Editor name [        ] Pre Flags [        ] Post Flags [        ] 0
  316. 1-------------------------------------------------------------------3
  317. @bright
  318. @END
  319. @nf BBMENU
  320. @bright
  321. @col char,white,blue
  322. @window line0,column0,depth2,width0
  323. @BBIMENU GREEN,BLUE
  324. @key bright,white,blue
  325. { Defaults }{ Interpret }{ Edit }{ Scr }{ Quit }{ View }{ MS-DOS shell }è@col char,white,blue
  326. @window line0,column70,depth1,width8
  327. F1=Help
  328. @BBHELP line 1,column 0,width 60,bright,white,red
  329. @HELP ' Change editor and application details and flags'
  330. @HELP ' Load a copy of Taskmaster to Interpret the named task '
  331. @HELP ' Load your nominated wordprocessor to Edit the task'
  332. @HELP ' Process the task using Scr to create an OVR or FORMS file'
  333. @HELP ' Leave this task - return from whence you came'
  334. @HELP ' Load LIST.COM to look at the nominated task'
  335. @HELP ' Get a DOS prompt for running things not on the menu '
  336. @END
  337. @nf HELP01
  338. @colour char,white,blue
  339. @GON
  340. @dim
  341. @WINDOW LINE 3,COLUMN 10,DEPTH 15,WIDTH 49
  342. @drop under,offset 2
  343. @outline cyan
  344.   Defaults-Option-Help
  345.  Hel≡ oε TMDEV.TSK║  Aε examplσ TASKMASTE╥ átasδ ì
  346. áfo≥ applicatioε developers«  Singlσ sourceΣ fo≥ ì
  347. áCDO╙ o≥ M╙-DO╙ operation«  (Uni° equivalen⌠ ái≤ ì
  348. áDEVELOP.TSK).
  349.  
  350. á Yo⌡ ámus⌠ áconfirφ thσ namσ oµ ß átasδ ábeforσ ì
  351. áselectinτ áoption≤ requirinτ ß tasδ name« á Thσ ì
  352. átasδ áwil∞ ápolicσ this«  Thσ áedito≥ ánamσ ái≤ ì
  353. áaskeΣ fo≥ onl∙ iµ thσ datafilσ TMDEV.T═ i≤ áno⌠ ì
  354. áavailable.
  355.  
  356.  Thσ áfilenamσ anΣ edito≥ namσ arσ árecordeΣ áiε ì
  357. áTMDEV.T═ fo≥ subsequen⌠ restoration.
  358. @END
  359. @nf HELP02
  360. @colour char,white,BLUE
  361. @GON
  362. @dim
  363. @WINDOW LINE 3,COLUMN 10,DEPTH 13,WIDTH 49
  364. @drop under,offset 2
  365. @outline cyan
  366.   Interpret-Option-Help
  367.  Thσ áINTERPRETÆ áoptioε load≤ áanothe≥ ácop∙ áoµ ì
  368. áTaskmaste≥ a≤ ß 'childº proces≤ whicΦ áattempt≤ ì
  369. át∩ executσ thσ nameΣ  task«  Wheε thi≤ á'childº ì
  370. áproces≤ ái≤ áterminateΣ á(duσ át∩ áerror≤ áá o≥ ì
  371. áexecutinτ áß STO╨ command⌐ contro∞ wil∞ áreturε ì
  372. át∩ TMDEV.
  373.  
  374.  Thσ PAT╚ wil∞ bσ useΣ t∩ locatσ Taskmaster«  Iµ ì
  375. áyo⌡ áwisΦ át∩ ánominatσ áß áspecifiπ ácop∙ ááoµ ì
  376. áTaskmaste≥ pleasσ se⌠ thσ environmen⌠ ávariablσ ì
  377. áFMPT═ accordingl∙ (FMPT═ ha≤ n∩ othe≥ use).ì
  378. @END
  379. @nf HELP03
  380. @colour char,white,BLUE
  381. @GONè@dim
  382. @WINDOW LINE 3,COLUMN 10,DEPTH 6,WIDTH 49
  383. @drop under,offset 2
  384. @outline cyan
  385.   Edit-Option-Help
  386.  Thσ átasδ wil∞ bσ editeΣ usinτ thσ áedito≥ áyo⌡ ì
  387. ánominatσ usinτ thσ DEFAULT╙ option«  B∙ defaul⌠ ì
  388. áLIS╘ ái≤ ánameΣ a≤ thσ editor¼  i⌠ i≤ áiε áfac⌠ ì
  389. ájus⌠ ß filσ viewer« 
  390. @END
  391. @nf HELP04
  392. @colour char,white,BLUE
  393. @GON
  394. @dim
  395. @WINDOW LINE 3,COLUMN 10,DEPTH 14,WIDTH 49
  396. @drop under,offset 2
  397. @outline cyan
  398.   SCR-Option-Help
  399.  Thσ á SCRù áoptioε áload≤ áTH┼ áSCREE╬ áTEMPLAT┼ ì
  400. áPROCESSORù áiµ i⌠ i≤ availablσ whicΦ ácreate≤ áß ì
  401. áfilσ ácalleΣ TASKNAME.OV╥ containinτ áprocesseΣ ì
  402. áforms« á Yo⌡ ma∙ looδ a⌠ thσ forφ sourcσ á(i.e« ì
  403. ábeforσ áthe∙ havσ beeε processed⌐ b∙ áexamininτ ì
  404. áthσ  TS╦ files╗ thσ form≤ arσ usuall∙ founΣ áa⌠ ì
  405. áthσ enΣ  oµ thσ file.
  406.  
  407.  Thσ áPAT╚ wil∞ bσ useΣ t∩ locatσ SCR« á Iµ áyo⌡ ì
  408. áwisΦ t∩ nominatσ ß specifiπ cop∙ oµ SC╥ ápleasσ ì
  409. áse⌠ thσ environmen⌠ variablσ FMPSC╥ accordingl∙ ì
  410. á(FMPSC╥ ha≤ n∩ othe≥ use)« 
  411. @END
  412. @nf HELP05
  413. @colour char,white,BLUE
  414. @GON
  415. @dim
  416. @WINDOW LINE 3,COLUMN 10,DEPTH 7,WIDTH 25
  417. @drop under,offset 2
  418. @outline cyan
  419.   Quit-Option-Help
  420.  Thσ  qui⌠ optioε simpl∙ 
  421. áreturn≤ t∩ thσ ácallinτ ì
  422. áprocess¼ áááthi≤ áááái≤ ì
  423. áusuall∙ ááthσ ááCommanΣ ì
  424. áLinσ Interpreter.
  425. @END
  426. @nf HELP06
  427. @colour char,white,BLUE
  428. @GON
  429. @dim
  430. @WINDOW LINE 3,COLUMN 10,DEPTH 5,WIDTH 25
  431. @drop under,offset 2
  432. @outline cyan
  433.   View-File-Option-Help
  434.  Thi≤ áinvoke≤ áLIS╘ át∩ ì
  435. ávie≈ áthσ ásourcσ áfilσ ì
  436. áselected.
  437. @END
  438. @nf help07
  439. @colour char,white,BLUE
  440. @GON
  441. @dim
  442. @WINDO╫ LIN┼ 3,COLUM╬ 10,DEPT╚ 12,WIDT╚ 25
  443. @dro≡ under,offse⌠ 2
  444. @outline cyan
  445.   MS-DOS-Shell-helpè Thi≤ ááload≤ áááanothe≥ ì
  446. ácommanΣ interprete≥ át∩ ì
  447. áallo≈ áyo⌡ át∩ áperforφ ì
  448. áan∙ command≤ yo⌡ áwish« ì
  449. áTaskmaste≥ áááááremain≤ ì
  450. áloadeΣ áanΣ ááresident« ì
  451. áWheε yo⌡ wisΦ t∩ returε ì
  452. át∩ áTaskmaste≥ á simpl∙ ì
  453. áente≥ áEXITü (thi≤ á
  454. ámen⌡ wil∞ rσ-appear)
  455. @end
  456. @nf HELP_GEN
  457. @colour char,white,BLUE
  458. @GON
  459. @WINDOW LINE 3,COLUMN 10,DEPTH 11,WIDTH 60
  460. @outline cyan
  461.   General-Help
  462.  Please  select  the option you require  using  the  <space
  463.  bar>, <arrow keys> or <home> key and pressing .
  464.                                                             
  465.  This  is an instant Bounce-bar menu so you may  press  the
  466.  first  character of any topic - in which case   is
  467.  not needed.
  468.                                                             
  469.  Context  sensitive help is available:  Highlight  a  topic
  470.  and press function key <F1>.
  471. @end
  472.  
  473. @nf tskmac
  474. @bbmenu cyan,blue
  475. @bright
  476. @win line0,column69,depth1,width10
  477. {TSK }{MAC }
  478.  Select...
  479. @end
  480. @eof
  481.